package com.bluefish.bltuan.action.user;

import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;

import com.bluefish.bltuan.action.OpenAction;
import com.bluefish.bltuan.tools.ActionUtil;

public class LogoutAction extends OpenAction {

    /**
     * 
     */
    private static final long serialVersionUID = 7776765335189016034L;

    @Override
    public HttpHeaders index() {
        if (ActionUtil.getCurrentUserId() != null)
            ActionUtil.removeUserId();
        if (ActionUtil.getCurrentUserRight() != null)
            ActionUtil.removeCurrentUserRight();
        return new DefaultHttpHeaders(TO_INDEX).disableCaching();
    }

}
